<div class="problemindexholder" problemindex="B">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     B. An express train to reveries
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     1 second
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     Sengoku still remembers the mysterious "colourful meteoroids" she discovered with Lala-chan when they were little. In particular, one of the nights impressed her deeply, giving her the illusion that all her fancies would be realized.
    </p>
    <p>
     On that night, Sengoku constructed a permutation
     <span class="tex-span">
      <i>
       p
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       p
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       p
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     of integers from
     <span class="tex-span">
      1
     </span>
     to
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     inclusive, with each integer representing a colour, wishing for the colours to see in the coming meteor outburst. Two incredible outbursts then arrived, each with
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     meteorids, colours of which being integer sequences
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       a
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     and
     <span class="tex-span">
      <i>
       b
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       b
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       b
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     respectively. Meteoroids' colours were also between
     <span class="tex-span">
      1
     </span>
     and
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     inclusive, and the two sequences were not identical, that is, at least one
     <span class="tex-span">
      <i>
       i
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       i
      </i>
      ≤
      <i>
       n
      </i>
     </span>
     ) exists, such that
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≠
      <i>
       b
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     holds.
    </p>
    <p>
     Well, she almost had it all — each of the sequences
     <span class="tex-span">
      <i>
       a
      </i>
     </span>
     and
     <span class="tex-span">
      <i>
       b
      </i>
     </span>
     matched exactly
     <span class="tex-span">
      <i>
       n
      </i>
      - 1
     </span>
     elements in Sengoku's permutation. In other words, there is exactly one
     <span class="tex-span">
      <i>
       i
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       i
      </i>
      ≤
      <i>
       n
      </i>
     </span>
     ) such that
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≠
      <i>
       p
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     , and exactly one
     <span class="tex-span">
      <i>
       j
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       j
      </i>
      ≤
      <i>
       n
      </i>
     </span>
     ) such that
     <span class="tex-span">
      <i>
       b
      </i>
      <sub class="lower-index">
       <i>
        j
       </i>
      </sub>
      ≠
      <i>
       p
      </i>
      <sub class="lower-index">
       <i>
        j
       </i>
      </sub>
     </span>
     .
    </p>
    <p>
     For now, Sengoku is able to recover the actual colour sequences
     <span class="tex-span">
      <i>
       a
      </i>
     </span>
     and
     <span class="tex-span">
      <i>
       b
      </i>
     </span>
     through astronomical records, but her wishes have been long forgotten. You are to reconstruct any possible permutation Sengoku could have had on that night.
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     The first line of input contains a positive integer
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     (
     <span class="tex-span">
      2 ≤
      <i>
       n
      </i>
      ≤ 1 000
     </span>
     ) — the length of Sengoku's permutation, being the length of both meteor outbursts at the same time.
    </p>
    <p>
     The second line contains
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     space-separated integers
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       a
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤
      <i>
       n
      </i>
     </span>
     ) — the sequence of colours in the first meteor outburst.
    </p>
    <p>
     The third line contains
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     space-separated integers
     <span class="tex-span">
      <i>
       b
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       b
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       b
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       b
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤
      <i>
       n
      </i>
     </span>
     ) — the sequence of colours in the second meteor outburst. At least one
     <span class="tex-span">
      <i>
       i
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       i
      </i>
      ≤
      <i>
       n
      </i>
     </span>
     ) exists, such that
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≠
      <i>
       b
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     holds.
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     Output
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     space-separated integers
     <span class="tex-span">
      <i>
       p
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       p
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       p
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     , denoting a possible permutation Sengoku could have had. If there are more than one possible answer, output any one of them.
    </p>
    <p>
     Input guarantees that such permutation exists.
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>5<br/>1 2 3 4 3<br/>1 2 5 4 5<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>1 2 5 4 3<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>5<br/>4 4 2 3 1<br/>5 4 5 3 1<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>5 4 2 3 1<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>4<br/>1 1 3 4<br/>1 4 3 4<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>1 2 3 4<br/></pre>
     </div>
    </div>
   </div>
   <div class="note">
    <div class="section-title">
     Note
    </div>
    <p>
     In the first sample, both
     <span class="tex-span">
      1, 2, 5, 4, 3
     </span>
     and
     <span class="tex-span">
      1, 2, 3, 4, 5
     </span>
     are acceptable outputs.
    </p>
    <p>
     In the second sample,
     <span class="tex-span">
      5, 4, 2, 3, 1
     </span>
     is the only permutation to satisfy the constraints.
    </p>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
